using Microsoft.EntityFrameworkCore;
using MyWebApi.Api.Entity;

namespace MyWebApi.Api.Db
{
    // 数据库上下文
    public class MyWebApiDb : DbContext
    {
        public MyWebApiDb(DbContextOptions options) : base(options)
        {

        }

        public DbSet<Users> Users { get; set; }
        public DbSet<AuditInfo> Auditlnfos { get; set; }
        public DbSet<Company> Company { get; set; }
        public DbSet<ContactPicture> ContactPicture { get; set; }
        public DbSet<Journalism> Journalism { get; set; }
        public DbSet<NewsComment> NewsComment { get; set; }
        public DbSet<NewsCoverPicture> NewsCoverPicture { get; set; }
        public DbSet<NewsStoryPraised> NewsStoryPraised { get; set; }
        public DbSet<NumberNewsReading> NumberNewsReading { get; set; }
        public DbSet<PutOnRecords> PutOnRecords { get; set; }

        // 连接数据库
        protected override void OnConfiguring(DbContextOptionsBuilder options)
            => options.UseSqlServer(@"server=.;database=CMSDb;uid=sa;pwd=1218;");

    }

}